package com.huawei.od;

/**
 *
 */
public class T4 {
    public static void main(String[] args) {
        int[] arr = {0, 0, 0, 0, 0, 0, 0};
        System.out.println(method(arr));
    }

    private static int method(int[] arr) {
        int count = 0;
        //优先处理头
        if (arr[0] == 0 && arr[1] == 0) {
            arr[0] = 1;
            count++;
        }

        for (int i = 1; i < arr.length - 1; i++) {
            if (arr[i] == 0 && arr[i - 1] == 0 && arr[i + 1] == 0) {
                arr[i] = 1;
                count++;
            }
        }

        if (arr[arr.length - 1] == 0 && arr[arr.length - 2] == 0) {
            arr[arr.length - 1] = 1;
            count++;
        }
        return count;
    }
}
